package com.codelabs.basicstatecodelab

import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier

/**
 * 任务列表虚假数据
 *
 * @author owner
 * @date 2024/3/18 16:41
 */


@Composable
fun WellnessTaskList(
    onCloseTask: (WellnessTask) -> Unit,
    modifier: Modifier = Modifier,
    list: List<WellnessTask> = remember { getWellnessTask() }
) {
    LazyColumn(modifier = modifier) {
        items(
            items = list,
            key = { task -> task.id }) { task ->
            WellnessTaskItem(
                taskName = task.label,
                onClose = { onCloseTask(task) })
        }
    }
}

